const answerService = require('../services/answerService');

exports.getAnswers = async (req, res, next) => {
  try {
    const answers = await answerService.getAnswers();
    res.json(answers);
  } catch (err) {
    next(err);
  }
};

exports.createAnswer = async (req, res, next) => {
  try {
    const answer = await answerService.createAnswer(req.body);
    res.json(answer);
  } catch (err) {
    next(err);
  }
};